package com.explorx.sns.puma.im.core.controller;

import com.explorex.puma.common.login.LoginUser;
import com.explorex.puma.common.login.UserContextHolder;
import com.explorex.puma.common.web.HttpResult;
import com.explorx.sns.puma.im.core.chat.NotificationService;
import com.explorx.sns.puma.im.core.chat.model.NotificationModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@RestController
@RequestMapping("/api/user")
public class NotificationController {

    @Resource
    private NotificationService notificationService;

    /**
     * /api/user/v1/notification
     * @return
     */
    @GetMapping("/v1/notification")
    public HttpResult getUserNotification(){

        final LoginUser userInfo = UserContextHolder.getUserInfo();
        List<NotificationModel> result=notificationService.queryNotification(100L);

        return HttpResult.success(result);
    }

}
